<tc_include file="Portal/Public/style" />
    <title>我的</title>
<tc_include file="Portal/Public/header" />
<!--header end-->
<div class="my_box main oh">
    <div class="my_left fl">
       <!--nav-->
        <tc_include file="Portal/Public/myNav" />
       <!--nav end-->
    </div>
    <div class="my_right fr">
        <form action="{:U('My/subInfor')}" method="post"  enctype='multipart/form-data'/>
            <div class="c_tit"><span>账号信息</span></div>
            <div class="myr_cont oh">
                <div class="my_count_left fl">
                    <p class="tit">来上传一张头像吧</p>
                    <div class="my_up_photo">
                        <!--第一种-->
                        <!--<img id="img" src="<?php if($data){ echo './Uploads'.$data['photo'];}else{echo '__IMG__/up_img.jpg'; } ?>" width="180" height="180" alt=""/>-->

                        <!--第二种-->
                        <!--
                        <?php if($data["photo"]) {?>
                            <img id="img" src="./Uploads<?php echo $data['photo']; ?>" width="180" height="180" alt=""/>
                        <?php }else{ ?>
                            <img id="img" src="__IMG__/up_img.jpg" width="180" height="180" alt=""/>
                        <?php } ?>
                        -->

                        <!--第三种-->
                        <if condition="$data['photo']">
                            <img id="img" src="./Uploads{$data['photo']}" width="180" height="180" alt=""/>
                            <else />
                            <img id="img" src="__IMG__/up_img.jpg'" width="180" height="180" alt=""/>
                        </if>

                    </div>
                    <div class="my_up_btn">
                        <img id="file_up_btn" src="__IMG__/up_btn.jpg" width="111" height="34" alt=""/>
                        <input id="file" style="display: none;" type="file" name="file"/>
                    </div>
                </div>
                <div class="my_count_right fl">
                    <p>昵称：<input type="text" name="nickname" placeholder="一图一世界" value="{$data['nickname']}"/></p>
                    <p>手机：<input type="text" name="tel" readonly style="cursor: not-allowed;" placeholder="123456789" value="{$count}"/></p>
                    <p>性质：<input type="text" name="sys" placeholder="个人" value="{$data['system']}"/></p>
                    <p>QQ：<input type="text"  name="qq" placeholder="4567896435" value="{$data['qq']}"/></p>
                    <p>微信：<input type="text" name="wechat" placeholder="lixiang01" value="{$data['wechat']}"/></p>
                    <input class="bcbtn" type="submit" value="保存"/>
                </div>
            </div>
        </form>
    </div>
</div>



<!--footer-->
<tc_include file="Portal/Public/footer" />
<script>
$(".my_left li:not('.tit1,.tit2')").click(function(){
    $(this).addClass("on").siblings().removeClass("on");
});

$("#file_up_btn").click(function(){
    $("#file").click();
});

$("#file").change(function (){
    var objUrl = getObjectURL(this.files[0]) ; //获取图片的路径，该路径不是图片在本地的路径
    if (objUrl) {
        $("#img").attr("src", objUrl) ; //将图片路径存入src中，显示出图片
    }
});

function getObjectURL(file) {
    var url = null ;
    if (window.createObjectURL!=undefined) {
        //basic
        url = window.createObjectURL(file);
    } else if (window.URL!=undefined) {
        // mozilla(firefox)
        url = window.URL.createObjectURL(file);
    } else if (window.webkitURL!=undefined) {
        // webkit or chrome
        url = window.webkitURL.createObjectURL(file);
    }
    return url;
}
</script>
</body>
</html>